
#pragma once

#include "GameStd.h"
#include "GameServices.h"
#include "InputManager.h"
#include "OgreManager.h"
#include "StateManager.h"
#include "ObjectManager.h"


//top most class in the class hierarchy
class GameEngine : public IGameEngine, public Ogre::FrameListener{
public:
	//start the game engine
	void Run();	

	//shut down the game engine
	void ShutDown();

	//Returns an int indicating the level of
	//details printed in the log
	int GetLoggingLevel();

	//singleton class, single instance and static access
	static IGameEngine* getSingleton(){
		if(_gameEngine == NULL)
			_gameEngine = new GameEngine();
		return (IGameEngine*)_gameEngine;
	}

protected:

	//protected constructor and destructor enforces singleton
	GameEngine();
	~GameEngine(){}

	//singleton instance of this class
	static IGameEngine* _gameEngine;

	void Initialize();
	bool frameStarted(const Ogre::FrameEvent& gameTime);
	bool frameEnded(const Ogre::FrameEvent& gameTime);
	void Cleanup();

	//is the game engine running
	bool _running;

	//list of active managers in the game engine
	std::vector<IGameManager*>* _gcList;

	//Read in from a file 
	//3 - Print all messages (including loop print outs)
	//2 - Print all important & informational messages
	//1 - Print only important messages
	//0 - Don't print messages
	int loggingLevel;
};